package com.hzzy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 首页默认页面模板地址访问
 * @author 何剑波
 * 2016年5月10日
 */
@Controller
public class HomePageController {

	/**
	 * 跳转 主页
	 * @param model
	 * @return
	 */
	@RequestMapping(value = {"/homePage"}, method = RequestMethod.GET)
	public String homePage(Model model) {
		return "homePage.page";
	}
	
	/**
	 * 加载homePage默认页面
	 * @param model
	 * @return
	 */
	@RequestMapping(value = "/index.{param1:[a-z]+}", method = RequestMethod.GET)
	public String printPage(Model model, @PathVariable String param1) {
		return  param1 + ".page";
	}
	
	/**
	 * 加载右侧功能页面
	 * @param model
	 * @param param1
	 * @return
	 */
	@RequestMapping(value = "/load{param1}", method = RequestMethod.GET)
	public String printRightContent(Model model, @PathVariable String param1) {
		return "rightContent." + param1;
	}
}
